import request from '/@/utils/request'

/**
 * 分页查询角色
 * @param data 
 * @returns 
 */
export const rolePage = (data: any) =>{
  return request.post('/sys/role/page',data)
}
/**
 * 角色详情
 * @param data 
 * @returns 
 */
export const roleDetail = (data: any) =>{
  return request.post('/sys/role/detail',data)
}
/**
 * 添加角色
 * @param data 
 * @returns 
 */
export const roleSave = (data: any) =>{
  return request.post('/sys/role/save',data)
}
/**
 * 修改角色
 * @param data 
 * @returns 
 */
export const roleUpdate = (data: any) =>{
  return request.post('/sys/role/update',data)
}
/**
 * 菜单列表
 * @param data 
 * @returns 
 */
export const menuList = (data: any)=> {
  return request.post('/sys/menu/list', data)
}
/**
 * 某个角色菜单列表
 * @param data 
 * @returns 
 */
export const roleMenuList = (data: any)=> {
  return request.post('/sys/rbac/roleMenuIds', data)
}

/**
 * 应用列表
 * @param data 
 * @returns 
 */
export const appList = (data: any)=> {
  return request.post('/sys/menu/appList', data)
}
/**
 * 保存角色菜单
 * @param data 
 * @returns 
 */
export const saveRoleMenu = (data: any)=> {
  return request.post('/sys/rbac/saveRoleMenu', data)
}
/**
 * 通过角色ID获取用户列表
 * @param data 
 * @returns 
 */
export const userListByRoleId = (data: any)=> {
  return request.post('/sys/rbac/userListByRoleId', data)
}
/**
 * 删除用户角色关系
 * @param data 
 * @returns 
 */
export const removeUserRole = (data: any)=> {
  return request.post('/sys/rbac/removeUserRole', data)
}
/**
 * 获取指定id角色
 * @param data 
 * {
 *   "roleID": 1
 * }
 * @returns 
 */
export const GetRoleFromID = (data: any)=> {
  return request.post('/Roles/GetRoleFromID', data)
}